package 生产者消费者模型;

public class Producer_02 implements Runnable {
    Data data = null;

    public Producer_02(Data data) {
        this.data = data;
    }

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            data.addData(i);
            System.out.println("生产者222，正在生产：" + i + "---长度为" + data.getDataLen());
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
